/**
 * Copyright ©2016-2022 tianyu education Corporation, All Rights Reserved
 * http://www.whty.com.cn/
 */
package profile.hujia.shiro.study.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import profile.hujia.shiro.study.model.UserDO;
import profile.hujia.shiro.study.service.UserService;

/**
 * class info
 *
 * @author hujia
 * @date 2019-12-09 16:28
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/user")
    public UserDO insertUser(@RequestBody UserDO userDO) {
        return userService.insertUser(userDO);
    }

    @GetMapping("user")
    public UserDO getUser(@RequestParam String userName) {
        return userService.getUser(userName);
    }
}